<?xml version="1.0" encoding="UTF-8" ?>
<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@include file="/common/tag.jsp"%>
	
<script type="text/javascript">	
	function save(){
		var id = $('input:radio:checked').val();
<%--		获取radio的几种方法--%>
<%--		$("input[type='radio']:checked").val();--%>
<%--		$("input[name='radio-role']:checked").val();--%>
		var par = "?roleId="+id;
		$("#roleForm").attr("action", "system/user/setRole.do"+par)
	}
	
</script>	
<div class="bjui-pageContent">
	<form method="post" id="roleForm"  action="" class="pageForm"
		data-toggle="ajaxform" data-reload-navtab="true">
		<div class="pageFormContent" data-layout-h="0">
		<input type="hidden" id="userId" name="userId" value="${userId}"></input>
		<table class="table table-condensed ">
                <tbody>
	                <c:forEach items="${roleList}" varStatus="vs" var="role">
	                <tr>
						<td>
							<input type="radio" data-toggle="icheck" name="radio-role"  value="${role.roleId}" 
							<c:if test="${role.checked == 'checked'}">checked</c:if> data-label="${role.name}">
						</td>
						</tr>	
					</c:forEach>
				</tbody>
            </table>
		
					
		</div>
		<div class="bjui-footBar">
			<ul onclick="save()">
				<li><button type="button" class="btn-close">关闭</button>
				</li>
				<li><button type="submit" class="btn-default">保存</button>
				</li>
			</ul>
		</div>
	</form>
</div>